package com.ruoyi.coupons.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 优惠券模板对象 coupon_templates
 * 
 * @author ruoyi
 * @date 2025-11-05
 */
public class CouponTemplates extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 券名称 */
    @Excel(name = "券名称")
    private String name;

    /** 券类型：满减、折扣、包邮 */
    @Excel(name = "券类型：满减、折扣、包邮")
    private String type;

    /** 优惠金额（单位：分） */
    @Excel(name = "优惠金额", readConverterExp = "单=位：分")
    private Long discountAmount;

    /** 折扣比例（如90表示9折） */
    @Excel(name = "折扣比例", readConverterExp = "如=90表示9折")
    private Long discountPercent;

    /** 最低消费金额（单位：分） */
    @Excel(name = "最低消费金额", readConverterExp = "单=位：分")
    private Long minSpend;

    /** 发放总量 */
    @Excel(name = "发放总量")
    private Long totalQuantity;

    /** 剩余可发放数量 */
    @Excel(name = "剩余可发放数量")
    private Long remainingQuantity;

    /** 每人限领数量 */
    @Excel(name = "每人限领数量")
    private Long perUserLimit;

    /** 生效时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生效时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 失效时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "失效时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 是否可与其他券叠加 */
    @Excel(name = "是否可与其他券叠加")
    private Integer stackable;

    /** 
创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    public void setType(String type) 
    {
        this.type = type;
    }

    public String getType() 
    {
        return type;
    }

    public void setDiscountAmount(Long discountAmount) 
    {
        this.discountAmount = discountAmount;
    }

    public Long getDiscountAmount() 
    {
        return discountAmount;
    }

    public void setDiscountPercent(Long discountPercent) 
    {
        this.discountPercent = discountPercent;
    }

    public Long getDiscountPercent() 
    {
        return discountPercent;
    }

    public void setMinSpend(Long minSpend) 
    {
        this.minSpend = minSpend;
    }

    public Long getMinSpend() 
    {
        return minSpend;
    }

    public void setTotalQuantity(Long totalQuantity) 
    {
        this.totalQuantity = totalQuantity;
    }

    public Long getTotalQuantity() 
    {
        return totalQuantity;
    }

    public void setRemainingQuantity(Long remainingQuantity) 
    {
        this.remainingQuantity = remainingQuantity;
    }

    public Long getRemainingQuantity() 
    {
        return remainingQuantity;
    }

    public void setPerUserLimit(Long perUserLimit) 
    {
        this.perUserLimit = perUserLimit;
    }

    public Long getPerUserLimit() 
    {
        return perUserLimit;
    }

    public void setStartTime(Date startTime) 
    {
        this.startTime = startTime;
    }

    public Date getStartTime() 
    {
        return startTime;
    }

    public void setEndTime(Date endTime) 
    {
        this.endTime = endTime;
    }

    public Date getEndTime() 
    {
        return endTime;
    }

    public void setStackable(Integer stackable) 
    {
        this.stackable = stackable;
    }

    public Integer getStackable() 
    {
        return stackable;
    }

    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("type", getType())
            .append("discountAmount", getDiscountAmount())
            .append("discountPercent", getDiscountPercent())
            .append("minSpend", getMinSpend())
            .append("totalQuantity", getTotalQuantity())
            .append("remainingQuantity", getRemainingQuantity())
            .append("perUserLimit", getPerUserLimit())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("stackable", getStackable())
            .append("createdAt", getCreatedAt())
            .toString();
    }
}
